package com.woniuxy.cloud.procurementassembly.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.woniuxy.cloud.procurementassembly.dto.BatteryOrderProcurementDetailsDto;
import com.woniuxy.cloud.procurementassembly.entity.BatteryOrderProcurementDetails;
import com.woniuxy.cloud.procurementassembly.mapper.BatteryOrderProcurementDetailsMapper;
import com.woniuxy.cloud.procurementassembly.service.BatteryOrderProcurementDetailsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.cloud.procurementassembly.util.WoniuBeanUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 周川雄
 * @since 2022-02-21
 */
@Service
public class BatteryOrderProcurementDetailsServiceImpl extends ServiceImpl<BatteryOrderProcurementDetailsMapper, BatteryOrderProcurementDetails> implements BatteryOrderProcurementDetailsService {

    @Override
    public List<BatteryOrderProcurementDetailsDto> FindProcurementDetailsByOrderId(Integer orderId) {
        List<BatteryOrderProcurementDetails> list = list(new QueryWrapper<BatteryOrderProcurementDetails>().ne("order_id", orderId).eq("order_status", 2));
        return WoniuBeanUtils.copyList(list, BatteryOrderProcurementDetailsDto.class);
    }
}
